#pragma once

#include "Point.h"
#include "Polygon.h"
#include <vector>

class Rubber
{
	Rubber(int *argc, char *argv[], int w, int h);

	static void display();
	static void mouse(int button, int state, int x, int y);
	static void passiveMotion(int x, int y);

	static Rubber *instance;
	const int scn_w, scn_h;

	int move_x, move_y;
	std::vector<Point> points;
	std::vector<Polygon> polygons;
	bool selected;

	void drawPolygons();
	void drawFilledPolygons();
	void drawConnectedPoints();
public:
	static Rubber* getInstance();
	static Rubber* getInstance(int *argc, char *argv[], int w, int h);
	void run();
};

